package com.example.mychat.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.util.Date;

@Data
public class Redpacket {
    @TableId(type = IdType.AUTO)
    private int id;

    private String username; //发红包者

    private int receiverId; //能看到红包的用户id，-2时表示写扩散的源消息

    private int redPacketNum; //红包数量

    private double redPacketAmount; //每份红包的金额

    private Date time;    //发布时间

    private int originId; //写扩散源消息的id

    public Redpacket() {

    }

    public Redpacket(String username, int receiverId, int redPacketNum, double redPacketAmount) {
        this.username = username;
        this.receiverId = receiverId;
        this.redPacketNum = redPacketNum;
        this.redPacketAmount = redPacketAmount;
        this.time = new Date();
    }

    public Redpacket(String username, int receiverId, int redPacketNum, double redPacketAmount, int originId) {
        this.username = username;
        this.receiverId = receiverId;
        this.redPacketNum = redPacketNum;
        this.redPacketAmount = redPacketAmount;
        this.originId = originId;
        this.time = new Date();
    }
}
